<%@ page language="java" import="java.util.*,myapp.Arithmetic"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>查看正确答案</title>
</head>
<body>
	<div align="center">
		<form action="arithmetic.jsp">
			<table border="0">

				<tr>
					<th>题目和正确答案</th>
					<th>你的答案</th>
					<th>是否正确</th>
				</tr>
				<%
					request.setCharacterEncoding("utf-8");
					String[] answer = request.getParameterValues("answer");
					String[] rightAnswer = request.getParameterValues("rightAnswer");
					String[] arith = request.getParameterValues("arith");
					for (int i = 0; i < 5; i++) {
				%>
				<tr>
					<td><input type="text" style="border: 0px" readOnly="true"
						name="Q&A" value="<%=arith[i]%>"></td>

					<td><input type="text" style="border: 0px" readOnly="true"
						name="answer" value="<%=answer[i]%>"></td>
					<td>
						<%
							if (answer[i].equals(rightAnswer[i])) {
									out.print("是");
								}
								if (!answer[i].equals(rightAnswer[i])) {
									out.print("否");
								}
						%>
					</td>

				</tr>
				<%
					}
				%>
			</table>

			<input type="submit" value="返回继续做题！">
		</form>
	</div>
</body>
</html>